// 账户类型
export const AccountType = [
        { text: '', value: 0 }
]

// 告警等级
export const AlarmLevel = [
        { text: '正常', value: 0, color: '#00FF00' },
        { text: '预警', value: 1, color: '#0000FF' },
        { text: '一般告警', value: 2, color: '#FFFF00' },
        { text: '严重告警', value: 3, color: '#FFA500' },
        { text: '危机告警', value: 4, color: '#FF0000' }
]

// 任务状态
export const TaskStatus = [
        { text: '已执行', value: 0 },
        { text: '终止', value: 1 },
        { text: '暂停', value: 2 },
        { text: '正在执行', value: 3 },
        { text: '未执行', value: 4 },
        { text: '超期', value: 5 },
        // { text: '任务失败', value: 6 },
        { text: '超时', value: 7 },
        { text: '暂停', value: 8 }
]

// 任务状态备注 和任务状态对应
export const TaskStatusRemarks = [
        { text: '执行完成：绿色', value: 0, color: "#3CB371" },
        { text: '中途终止：棕色', value: 1, color: "#D2691E" },
        { text: '中途暂停：青色', value: 2, color: "#00FFFF" },
        { text: '正在执行：红色', value: 3, color: "#FF4500" },
        { text: '等待执行：蓝色', value: 4, color: "#4169E1" },
        { text: '超期：黄色', value: 5, color: "#FFD700" },
        // { text: '任务失败：灰色', value: 6, color: "#A9A9A9"},
        { text: '超时：紫色', value: 7, color: "#DA70D6" },
        { text: '中途暂停：青色', value: 8, color: "#00FFFF" }
]

// 日志类型
export const LogsTypes = [
        { text: '系统', value: 0 },
        { text: '机器人', value: 1 },
        { text: '客户端', value: 2 },
]

// 选件类型对应路由
export const InspectTypePath = [
        { text: '全面巡视', value: 1, path: '/tasks/comprehensive-inspection' },
        { text: '例行巡视', value: 2, path: '/tasks/routine-inspection' },
        { text: '专项巡视', value: 3, path: '/tasks/custom-task' },
        { text: '特殊巡视', value: 4, path: '/tasks/custom-task' },
        { text: '红外测温', value: 5, path: '/tasks/infrared-temperature' },
        { text: '油位油温表抄录', value: 6, path: '/tasks/oil-transcribe' },
        { text: '避雷器表计抄录', value: 7, path: '/tasks/arrester-transcribe' },
        { text: 'SP6压力抄录', value: 8, path: '/tasks/pressure-transcribe' },
        { text: '液压表抄录', value: 9, path: '/tasks/hydraulic-transcribe' },
        { text: '位置状态识别', value: 10, path: '/tasks/position-status' },
        { text: '恶劣天气巡检', value: 11, path: '/tasks/bad-weather' },
        { text: '缺陷跟踪', value: 12, path: '/tasks/defect-tracking' },
        { text: '迎峰度夏特巡', value: 13, path: '/tasks/bad-weather' },
        { text: '雷暴天气特巡', value: 14, path: '/tasks/bad-weather' },
        { text: '防汛抗台特巡', value: 15, path: '/tasks/bad-weather' },
        { text: '雨雪冰冻特巡', value: 16, path: '/tasks/bad-weather' },
        { text: '雾霾天气特巡', value: 17, path: '/tasks/bad-weather' },
        { text: '大风大气特巡', value: 18, path: '/tasks/bad-weather' },
        { text: '远方异常告警确认', value: 19, path: '/tasks/custom-task' },
        { text: '远方状态确认', value: 20, path: '/tasks/custom-task' },
        { text: '安防联动', value: 21, path: '/tasks/custom-task' },
        { text: '协助应急事故处理', value: 22, path: '/tasks/custom-task' },
]

// 日志类型
export const ReportColumn = [
        { text: '识别结果', value: 1, prop: "pointHistory.value" },
        { text: '识别类型', value: 2, prop: "reconType.name" },
        { text: '点位名称', value: 3, prop: "point.name" },
        { text: '识别时间', value: 4, prop: "pointHistory.reconTime" },
        { text: '设备区域', value: 5, prop: "deviceArea" },
        { text: '间隔名称', value: 6, prop: "interval" },
        { text: '设备名称', value: 7, prop: "deviceName" },
        { text: '设备类型', value: 8, prop: "deviceType" },
        { text: '表计类型', value: 9, prop: "meterType.name" },
        { text: '设备外观类型', value: 10, prop: "faceType.name" },
        { text: '发热类型', value: 11, prop: "hotType.name" },
        { text: '识别状态', value: 12, prop: "pointHistory.reconStatus" },
        { text: '审核结果', value: 13, prop: "pointHistory.modifyValue" },
        { text: '环境温度', value: 14, prop: "taskHistory.temp" },
        { text: '环境风速', value: 15, prop: "taskHistory.wind" },
        { text: '告警等级', value: 16, prop: "alarmLevel" },
        { text: '告警类型', value: 17, prop: "alarmType.name" },
        { text: '采集信息', value: 18, prop: "" },
        { text: '是否审核', value: 19, prop: "pointHistory.checkStatus" },
]

export const LineSpeeds = [
        { value: 0, text: 0.1 },
        { value: 1, text: 0.2 },
        { value: 2, text: 0.3 },
        { value: 3, text: 0.4 },
        { value: 4, text: 0.5 },
        { value: 5, text: 0.6 },
        { value: 6, text: 0.7 },
        { value: 7, text: 0.8 },
        { value: 8, text: 0.9 },
        { value: 9, text: 1.0 }
]

// 点位类型
export const PointType = [
        { text: '点', value: 0 },
        { text: '面', value: 1 },
]

// 表计读数特殊取值
export const MeterReadingDealWith = [
        { text: '未储能', value: 30001 },
        { text: '已储能', value: 30002 },
        { text: '分', value: 10001 },
        { text: '合', value: 10002 },
        { text: '异常', value: 10003 },
        { text: '停止', value: 20000 },
        { text: '流动', value: 20001 },
        { text: '识别失败', value: -404 },
]

export function matchArrayContent(val, array) {
        if (!array.length || (!val && val != 0) || val.length == 0) return val
        for (let i = 0; i < array.length; i++) {
                if (val === array[i].value) return array[i].text
        }
        return val;
}

export function matchArrayContentWithKey(key, val, array) {
        if (!array.length || (!val && val != 0) || val.length == 0) return val
        for (let i = 0; i < array.length; i++) {
                if (val === array[i].value) return array[i][key]
        }
}